package com.uniapp.java.uniappjava.service;

import com.uniapp.java.uniappjava.dao.UserDao;
import com.uniapp.java.uniappjava.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    public void save(User user) {
        userDao.save(user);
    }

    public User findById(String id) {
        return userDao.findById(id).orElse(null);
    }

    public User findByUserName(String userName) {
        return userDao.findByUserName(userName);
    }
}
